# ifndef __DFX_FILE_WRITER_H__
# define __DFX_FILE_WRITER_H__

# include "dfxStream.h"

namespace DFX
{
    class DFX_EXPORT FileWriter : public OutputStream
    {
    private:

        String	mFileName;
        UInt64	mPosition;
        FILE    *mMapFile;

    public:

        FileWriter()
            : mPosition(0), mMapFile(NULL)
        {
        }

        ~FileWriter()
        {
            Close();
        }

        const String& GetFileName() const
        {
            return mFileName;
        }

        UInt64 GetPosition() const
        {
            return mPosition;
        }

        DFXRESULT Open(const String &fileName);

        void Close();
        void Seek(UInt64 position);

        UInt64 Write(const void *buffer, UInt64 size);
    };
}

# endif